<template>
	<view class="">
		<view class="bg padding">
			<view class="box">
				<view class="tit">可用资金(元)</view>
				<view class="pri"><text>{{balance?balance:'0'}}</text> 元</view>
				<view class="flex align-center justify-between margin-top-xl">
					<view class="">
						<view>总资金</view>
						<view style="font-size: 44rpx;">{{money?money:'0'}}</view>
					</view>
					<!-- <view class="">
						<view>冻结资金</view>
						<view style="font-size: 44rpx;">2.00</view>
					</view> -->
				</view>
			</view>
			<view class="flex align-center justify-between padding-top">
				<view>
					<view class="padding-bottom-xs">总资产（元）</view>
					<view class="text-bold" style="font-size: 48rpx;">{{money?money:'0'}}</view>
				</view>
				<view class="flex align-center">
					<view class="cz" @click="goTo('/my/wallet/Txmoney')">提现</view>
					<!-- <view class="tx" @click="gocz()">充值</view> -->
				</view>
			</view>
		</view>

		<!-- 我的列表 -->
		<view class="mylist">
			<view class="list_box" @click="goTo('/my/wallet/Acontlist')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/zijin.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">资金明细</view>
				</view>
				<view class="">
					<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>
			<view class="list_box" @click="goTo('/my/wallet/zhifubao')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/zhanghao.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">提现账号</view>
				</view>
				<view class="">
					<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>
			<view class="list_box" @click="goTo('/my/wallet/cashList')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/tixian.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">提现记录</view>
				</view>
				<view class="">
					<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				balance: 0,
				money: 0,
				mylist: [{
					id: 1,
					name: '保证金',
					image: 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/rider/qqq.png'
				}, {
					id: 2,
					name: '账户明细',
					image: 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/huoyunsf/rider/qq.png'
				}],
				shangxian: '是'
			}
		},
		onLoad() {
			this.shangxian = uni.getStorageSync('shangxian')
		},
		onShow() {
			this.taskData()
			this.getUserInfo()
		},
		methods: {
			// 获取个人信息
			getUserInfo() {
				this.$Request.getT("/app/userinfo/findUserInfoById").then(res => {
					if (res.code == 0) {
						this.balance = res.data.balance
					} else {
						this.$queue.logout();
						uni.showModal({
							showCancel: false,
							title: '登录失败',
							content: res.msg,
						});
					}
				});
			},
			goTo(url) {
				uni.navigateTo({
					url
				})
			},
			// 获取任务数据
			taskData() {
				this.$Request.getT('/app/userinfo/findBalance').then(res => {
					if (res.code == 0) {
						if (res.data) {
							this.money = res.data
						}

					}
					console.log('res', res)

				});
			},
			bindTxmoney() {
				uni.navigateTo({
					url: '/pages/riderMy/myAccount/Txmoney/Txmoney'
				})
			},
		}
	}
</script>

<style lang="less">
	page {
		background: #F5F5F5;
	}

	.bg {
		background: #FFFFFF;
	}

	.box {
		width: 690rpx;
		// height: 312rpx;
		background: linear-gradient(90deg, #02B595 0%, #02B595 100%);
		border-radius: 16rpx;
		color: #FFFFFF;
		// text-align: center;
		padding: 50rpx 40rpx 30rpx;


		.tit {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
		}

		.pri {
			margin-top: 20rpx;

			text {
				font-size: 68rpx;
				font-family: DINPro;
				font-weight: 500;
				color: #FFFFFF;
				margin-right: 10rpx;
			}
		}
	}

	.tx {
		width: 160rpx;
		height: 70rpx;
		border: 3rpx solid #02B595;
		border-radius: 8rpx;
		text-align: center;
		line-height: 70rpx;
		color: #02B595;
	}

	.cz {
		width: 160rpx;
		height: 70rpx;
		border-radius: 8rpx;
		text-align: center;
		line-height: 70rpx;
		color: #FFFFFF;
		margin-left: 20rpx;
		background: #02B595;
	}


	/* 我的列表 */
	.mylist {
		background-color: #FFFFFF;
		margin-top: 20rpx;
		padding: 30rpx 28rpx;
	}

	.list_box {
		display: flex;
		height: 95rpx;
		align-items: center;
	}

	.list_left {
		flex: 1;
		display: flex;
		justify-content: left;
		align-items: center;

		.t {
			letter-spacing: 1rpx;
		}
	}
</style>